<template>
  <div class="app-container home">
    <div class="nav">
      <div class="tab">
        <div class="left">
          <img src="../assets/img/index-icon1.png" alt="">
        </div>
        <div class="right">
          <div class="name">年度代表履职总次数</div>
          <div class="num">1428</div>
        </div>
      </div>
      <div class="tab">
        <div class="left">
          <img src="../assets/img/index-icon2.png" alt="">
        </div>
        <div class="right">
          <div class="name">民情动态</div>
          <div class="num">415</div>
        </div>
      </div>
      <div class="tab">
        <div class="left">
          <img src="../assets/img/index-icon3.png" alt="">
        </div>
        <div class="right">
          <div class="name">代表活动</div>
          <div class="num">287</div>
        </div>
      </div>
      <div class="tab">
        <div class="left">
          <img src="../assets/img/index-icon4.png" alt="">
        </div>
        <div class="right">
          <div class="name">代表建议</div>
          <div class="num">128</div>
        </div>
      </div>
      <div class="tab">
        <div class="left">
          <img src="../assets/img/index-icon5.png" alt="">
        </div>
        <div class="right">
          <div class="name">建议办结</div>
          <div class="num">124</div>
        </div>
      </div>
    </div>
    <div class="chart-wrapper">
      <div class="tab-list">
        <div class="tab active">
          未来7日
        </div>
        <div class="tab">
          近七日
        </div>
        <div class="tab">
          近一个月
        </div>
        <div class="tab">
          近三个月
        </div>
        <div class="tab">
          近半年
        </div>
        <div class="tab">
          近一年
        </div>
      </div>
      <bar-chart />
    </div>
  </div>
</template>

<script>
import BarChart from './dashboard/BarChart'
export default {
  name: "Index",
  data() {
    return {
      // 版本号
      version: "3.8.7"
    };
  },
  components: {
    BarChart
  },
  methods: {
    goTarget(href) {
      window.open(href, "_blank");
    }
  }
};
</script>

<style scoped lang="scss">
.home {
  margin: 30px;

  .nav {
    display: flex;
    justify-content: space-between;

    .tab {
      display: flex;
      align-items: center;
      width: 19%;
      padding: 20px;
      background: #fff;
      border-radius: 15px;

      .left {
        width: 80px;
        height: 80px;
        line-height: 80px;
        text-align: center;
        border-radius: 50%;
      }

      &:nth-of-type(1) .left {
        background: #E7F1FF;
      }

      &:nth-of-type(2) .left {
        background: #EFE3FF;
      }

      &:nth-of-type(3) .left {
        background: #FFE5CC;
      }

      &:nth-of-type(4) .left {
        background: #E7F1FF;
      }

      &:nth-of-type(5) .left {
        background: #D5FAEF;
      }

      .right {
        padding-left: 10px;

        .num {
          font-size: 20px;
          padding-top: 17px;
          color: #333333;
        }
      }
    }
  }

  .chart-wrapper {
    padding-bottom: 50px;
    margin-top: 20px;
    background: #fff;
    border-radius: 15px;
overflow: hidden;

    .tab-list {
      margin-bottom: 20px;
      display: flex;
      flex-direction: row;
      overflow-x: auto;
      white-space: nowrap;
      font-size: 16px;
      background: #fff;
      border-bottom: 1px solid #ededed;

      .tab {
        cursor: pointer;
        margin-right: 20px;
        padding: 20px 25px;
        display: flex;
        align-items: center;
        justify-content: center;

        &.active {
          position: relative;
          color: #1170C5;

          &:after {
            position: absolute;
            bottom: 0;
            content: "";
            width: 60px;
            height: 4px;
            background: #1170C5;
            border-radius: 10px;
          }
        }
      }
    }
  }
}
</style>
